package com.java.service.impl;

import java.util.Date;  

import javax.jws.WebParam;  
import javax.jws.WebService;  
import javax.jws.soap.SOAPBinding;  
import javax.jws.soap.SOAPBinding.Style;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.java.entity.User;
import com.java.service.ICalculatorService;
import com.java.service.IUserService;  
  
/** 
 * <b>function:</b> WebService传递复杂对象，如JavaBean、Array、List、Map等 
 */  
@WebService  
@SOAPBinding(style = Style.RPC)  
public class CalculatorServiceImpl implements ICalculatorService {  
	private static final Logger logger = LoggerFactory.getLogger(CalculatorServiceImpl.class);
	//加法  
	@Override
    public float plus(float x, float y) {  
		logger.debug("############CalculatorServiceImpl plus###########");
        logger.debug("x:" + x+",y:"+y); 
        return x + y;  
    }  
    //减法  
    @Override
    public float minus(float x, float y) {  
		logger.debug("############CalculatorServiceImpl minus###########");
        logger.debug("x:" + x+",y:"+y); 
        return x - y;  
    }  
    //乘法 
    @Override
    public float multiply(float x, float y) {  
		logger.debug("############CalculatorServiceImpl multiply###########");
        logger.debug("x:" + x+",y:"+y); 
        return x * y;  
    }  
    //除法  
    @Override
    public float divide(float x, float y) {  
		logger.debug("############CalculatorServiceImpl divide###########");
        logger.debug("x:" + x+",y:"+y); 
        if(y!=0)  
        {  
            return x / y;  
        }  
        else  
            return -1;  
    }
}  